package com.itheima.pattern.t2_factory.demo3;

/**
 * 咖啡商店
 */
public class CoffeeStore {

    private CoffeeFactory factory;

    // 点咖啡功能
    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        // 加配料
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }
}
